package com.tuling.llmlangchain4j.controller;

import com.tuling.llmlangchain4j.bean.FromChat;
import com.tuling.llmlangchain4j.service.Assistant;
import com.tuling.llmlangchain4j.service.SeparateAsssisant;
import com.tuling.llmlangchain4j.service.SmartAssisant;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Tag(name = "助手小智")
@RestController
@RequestMapping("/chat")
public class AssistantController {

    @Autowired
    SmartAssisant smartAssisant;

//    @Autowired
//    private SeparateAsssisant separateAsssisant;

    @PostMapping("/smartAssisant")
    public String chat(@RequestBody FromChat fromChat) {
        String chatResult = smartAssisant.chat(fromChat.getMemrryId(), fromChat.getMessage());
        System.out.println(chatResult);
        return chatResult;
    }
}
